<template>
	<view class="content">
		<view>{{userInfo.nickname}}</view>
		<view>当前鸭鸭卡：{{userInfo.source}}</view>
		<div class="li" @click="toUrl('/pages/my/userinfo/userinfo')">个人信息</div>
		<div class="li" @click="toUrl('/pages/my/task/task')">任务记录</div>
		<div class="li" @click="toUrl('/pages/my/exchange/exchange')">兑换记录</div>
		<div class="li" @click="toUrl('/pages/my/integral/integral')">鸭鸭卡记录</div>
	</view>
</template>

<script>
	import {
		getAction
	} from '../../../common/request';
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		onShow() {
			this.getUserInfo()
		},
		methods: {
			getUserInfo() {
				getAction('/user').then(res => {
					this.userInfo = res.data
				})
			},
			toUrl(url) {
				uni.navigateTo({
					url: url
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		padding-top: 120rpx;
		color: #2B2B2B;
		box-sizing: border-box;

		>view:nth-of-type(1) {
			text-align: center;
			font-size: 60rpx;
			line-height: 72rpx;
			margin-bottom: 48rpx;
		}

		>view:nth-of-type(2) {
			text-align: center;
			font-size: 28rpx;
			line-height: 36rpx;
			margin-bottom: 158rpx;
		}

		.li {
			width: 690rpx;
			height: 100rpx;
			line-height: 100rpx;
			background: #F5F5F5;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			margin: 0 auto;
			margin-bottom: 40rpx;
			font-size: 28rpx;
			padding-left: 40rpx;
			box-sizing: border-box;
		}
	}
</style>